home *** CD-ROM | disk | FTP | other *** search
/ Gigantic Games 2 / Gigantic Games 2.iso / pc / _b_ / blackjacktrainer / bj_trainer.amos / bj_trainer.amosSourceCode < prev    next >
AMOS Source Code  |  1994-12-23  |  34KB  |  1,171 lines

  1. '*      BLACK TRAINER      * 
  2. '*    by Peter Cartwright  * 
  3. '*     written in AMOS     *   
  4. '*************************** 
  5. Set Buffer 10
  6. Screen Open 0,320,200,16,Lowres
  7. Dim TLX(3),TLY(3),BRX(3),BRY(3)
  8. Dim HARD_DBL(3,10),SOFT_DBL(8,10),HARD_HIT(6,10),SOFT_HIT(4,10),SPLIT(10,10)
  9. Dim CARD_PACK$(208),NUM_OF_ACES(3),SOFT(3),PL4YER_COUNT(2)
  10. Dim PL4YERX(2),BUST(2),STAKE(2),DUBBLED(2),LINE$(3),BUTTON$(3),SPEED_ARR$(3)
  11. Global STAKE(),HAND,BLUE_CHIPS,RED_CHIPS,B0B,BANK,PL4YER_COUNT(),DEALER_COUNT
  12. Global NUM_OF_ACES(),SOFT(),POS,HAND,OWES_50P
  13. Global A$,FILELEN,RMARGIN,LMARGIN
  14. BOTTOM_CARD=197-(Rnd(8))
  15. T0P_CARD=0 : SPEED=7 : Set Talk 0,0,110, : Say "Blackjack Trainer."
  16. _LOAD_ARRAY
  17. PL4YERX(1)=208 : PL4YERX(2)=110 : PL4YERY=36 : DEALERX=132 : DEALERY=0
  18. RESTART=True
  19. FRONT_END
  20. '++++++++++++++++++++++++++
  21. '+ Blackjack Starts Here  +  
  22. '++++++++++++++++++++++++++
  23. MAIN:
  24. Auto View Off 
  25. Screen Open 0,320,200,32,Lowres
  26. Flash Off 
  27. Curs Off 
  28. Limit Mouse 128,44 To 444,240
  29. 'Load Iff "Dh0:dpaint/lo-res/table",0
  30. 'Follow  
  31. Unpack 6 To 0
  32. Fade 1 : Wait 15
  33. Auto View On 
  34. Screen Display 0,128,42,,
  35. Fade 3,0,$FFF,$C00,$93,$A,$EF0,$F77,$E4F,$F0C,$A0F,$0,$FED,$FE0,$CCC,$888,$444
  36. Wait 45
  37. Get Sprite Palette 
  38. Double Buffer 
  39. Reserve Zone 7
  40. SET_ZONES
  41. AN$="A 6,(64,8)(65,8)"
  42. RMARGIN=4 : LMARGIN=0 : Rem Margins for text reader
  43. Ink 2,3
  44. BANK=200
  45. MAKE_PACK
  46. SHUFFLE
  47. ST4RT:
  48. HAND=1
  49. B0B=1
  50. For I=1 To 2
  51.    BUST(I)=False : DUBBLED(I)=False
  52. Next I
  53. SPLIT=False
  54. HAND_FINISHED=False
  55. SPLIT_POSSIBLE=False
  56. POS=0
  57. For I=1 To 3
  58.    NUM_OF_ACES(I)=0
  59.    SOFT(I)=False
  60. Next I
  61. PLACE_BET
  62. ' PLACE_BET uses  bobs 1 and 2 for original bet  
  63. ' bobs 3 and 4 are used split  
  64. ' bobs 5 to  8 are used for doubles
  65. If RESTART=True : Rem  Esc pressed in PLACE_BET
  66.    Sprite Off 1
  67.    FRONT_END
  68.    Goto MAIN
  69. End If 
  70. STAKE(HAND)=BET
  71. ' Deal 2 cards to player and 1 to dealer 
  72. PL0FFSETX=PL4YERX(HAND) : PL0FFSETY=PL4YERY
  73. B0B=8 : Rem B0B is now 8 and DEAL_CARD adds 1 more to start at 9.
  74. DEAL_CARD : ADJUST_HAND[HAND]
  75. Wait SPEED
  76. PL4YER_COUNT(HAND)=RANK
  77. PL0FFSETX=DEALERX : PL0FFSETY=DEALERY
  78. DEAL_CARD : Inc POS
  79. Wait SPEED
  80. ADJUST_HAND[3]
  81. DEALER_COUNT=RANK
  82. PL0FFSETX=PL4YERX(HAND) : PL0FFSETY=PL4YERY
  83. DEAL_CARD : Inc POS
  84. ADJUST_HAND[HAND]
  85. ' Check for split - 2 tens is a bad split so is not offered
  86. ' thus saving a lot of progamming to sort out picture cards! 
  87. If PL4YER_COUNT(HAND)=RANK and RANK<>10 and SPLIT=False
  88.    SPLIT_POSSIBLE=True
  89.    Say "You may split if you wish."
  90. End If 
  91. PL4YER_COUNT(HAND)=PL4YER_COUNT(HAND)+RANK
  92. If PL4YER_COUNT(HAND)=21
  93.    Say "                blackjack."
  94.    PL4YER_COUNT(HAND)=99
  95.    HAND_FINISHED=True
  96. End If 
  97. ADVICE_GIVEN=False
  98. While HAND_FINISHED=False
  99.    If HELPME
  100.       If Not ADVICE_GIVEN
  101.          HELP
  102.          ADVICE_GIVEN=True
  103.       End If 
  104.    End If 
  105.    Repeat 
  106.       NEWZONE=Mouse Zone
  107.       If Key State(95)=True Then HELP
  108.       ' Esc has been pressed 
  109.       If Key State(69)=True
  110.          Fade 3 : Wait 50
  111.          Sprite Off 1
  112.          RESTART=True
  113.          FRONT_END
  114.          Goto MAIN
  115.       End If 
  116.    Until Mouse Click and NEWZONE<>0
  117.    If NEWZONE=1
  118.       HAND_FINISHED=True
  119.    End If 
  120.    If NEWZONE=2
  121.       DEAL_CARD : Inc POS
  122.       ADVICE_GIVEN=False
  123.       ADJUST_HAND[HAND]
  124.       PL4YER_COUNT(HAND)=PL4YER_COUNT(HAND)+RANK
  125.       'If bust, check for any fresh aces.
  126.       If PL4YER_COUNT(HAND)>21 and NUM_OF_ACES(HAND)>0
  127.          Dec NUM_OF_ACES(HAND)
  128.          PL4YER_COUNT(HAND)=PL4YER_COUNT(HAND)-10
  129.          If NUM_OF_ACES(HAND)=0 : Rem only one unaccounted for ace was present 
  130.             SOFT(HAND)=False
  131.          End If 
  132.       End If 
  133.       If PL4YER_COUNT(HAND)>21 and PL4YER_COUNT(HAND)<>99
  134.          Wait SPEED
  135.          Say "                     Bust."
  136.          HAND_FINISHED=True
  137.          BUST(HAND)=True
  138.          TAKE_MONEY
  139.          If Not SPLIT
  140.             Bob Off : Wait Vbl 
  141.             Goto ST4RT
  142.          End If 
  143.       End If 
  144.       If PL4YER_COUNT(HAND)=21
  145.          Say "player has twenty one."
  146.          Wait SPEED
  147.          HAND_FINISHED=True
  148.       End If 
  149.       Wait SPEED : Rem avoid double hit?  
  150.    End If 
  151.    If NEWZONE=3 and SPLIT_POSSIBLE=True and SPLIT=False
  152.       _SPLIT_PROC
  153.    End If 
  154.    ' If the hand is soft (SOFT*10) will equal -10 
  155.    If NEWZONE=4 and PL4YER_COUNT(HAND)+(SOFT(HAND)*10)<12 and POS=2
  156.       _D0UBLE_PROC
  157.    End If 
  158.    If SPLIT=True and HAND=1 and HAND_FINISHED=True
  159.       HAND_FINISHED=False
  160.       Inc HAND
  161.       POS=2
  162.       PL0FFSETX=PL4YERX(HAND)
  163.       Channel 1 To Bob 30
  164.       AM$="Move -100,0,35"
  165.       Amal 1,AM$ : Amal On 
  166.       While Chanmv(1)
  167.       Wend 
  168.       Bell 
  169.       Wait 40
  170.       ADVICE_GIVEN=False
  171.    End If 
  172. Wend 
  173. ' If both hands bust, no need for dealer to deal 
  174. If BUST(1) and BUST(2)
  175.    Bob Off : Wait Vbl 
  176.    Goto ST4RT
  177. End If 
  178. ' If player has blackjack, check to see if dealer can get one  
  179. If PL4YER_COUNT(HAND)=99
  180.    If DEALER_COUNT<>11 and DEALER_COUNT<>10
  181.       PAY_SIX_TO_4
  182.       Bob Off : Wait Vbl 
  183.       Goto ST4RT
  184.    End If 
  185. End If 
  186. POS=1
  187. While DEALER_COUNT<17
  188.    PL0FFSETX=DEALERX : PL0FFSETY=DEALERY
  189.    DEAL_CARD : Inc POS
  190.    Wait SPEED
  191.    ADJUST_HAND[3]
  192.    DEALER_COUNT=DEALER_COUNT+RANK
  193.    ' Check for a dealer blackjack 
  194.    If DEALER_COUNT=21 and POS=2
  195.       Say "    Dealer gets blackjack."
  196.       If PL4YER_COUNT(HAND)=99
  197.          Say "              Standoff."
  198.          BANK=BANK+STAKE(HAND)
  199.          CLAIM_STAKE
  200.       Else 
  201.          Say "              Dealer wins."
  202.          TAKE_MONEY
  203.       End If 
  204.       Bob Off : Wait Vbl 
  205.       Goto ST4RT
  206.    End If 
  207.    If PL4YER_COUNT(HAND)=99 and POS=2
  208.       Say "              player wins."
  209.       PAY_SIX_TO_4
  210.       Bob Off : Wait Vbl 
  211.       Goto ST4RT
  212.    End If 
  213.    'Before adjusting "soft" hands, check to see if it is between 16 & 22
  214.    If DEALER_COUNT>16 and DEALER_COUNT<22 and NUM_OF_ACES(3)>0 Then Exit 
  215.    'ADJUST "soft"HAND If BUST 
  216.    If DEALER_COUNT>21 and NUM_OF_ACES(3)>0
  217.       Dec NUM_OF_ACES(3) : Rem Adjustment made so cancel this ace.
  218.       DEALER_COUNT=DEALER_COUNT-10
  219.    End If 
  220. Wend 
  221. ' Who's won? 
  222. If Not SPLIT
  223.    If DEALER_COUNT>21
  224.       Say "             Dealer Busts."
  225.       PAY_EVENS
  226.       Bob Off : Wait Vbl 
  227.       Goto ST4RT
  228.    End If 
  229.    If DEALER_COUNT>PL4YER_COUNT(HAND)
  230.       Say "              Dealer wins."
  231.       TAKE_MONEY
  232.       Wait 30
  233.       Bob Off : Wait Vbl 
  234.       Goto ST4RT
  235.    End If 
  236.    If DEALER_COUNT=PL4YER_COUNT(HAND)
  237.       Say "                Stand Off."
  238.       BANK=BANK+STAKE(HAND)
  239.       CLAIM_STAKE
  240.       Bob Off : Wait Vbl 
  241.       Goto ST4RT
  242.    End If 
  243.    Say "                player wins."
  244.    PAY_EVENS
  245.    Bob Off : Wait Vbl 
  246.    Goto ST4RT
  247. Else 
  248.    If DEALER_COUNT>21
  249.       Say "              dealer busts."
  250.       For HAND=1 To 2
  251.          If BUST(HAND)=False
  252.             Say "      pay hand "+Str$(HAND)+"."
  253.             PAY_EVENS
  254.          End If 
  255.       Next HAND
  256.       Bob Off 
  257.       Goto ST4RT
  258.    End If 
  259.    For HAND=1 To 2
  260.       If DEALER_COUNT>PL4YER_COUNT(HAND) and BUST(HAND)=False
  261.          Say "   Dealer wins hand"+Str$(HAND)+"."
  262.          TAKE_MONEY
  263.          Wait 30
  264.          If HAND=2
  265.             Bob Off : Wait Vbl 
  266.          End If 
  267.       End If 
  268.       If DEALER_COUNT<PL4YER_COUNT(HAND) and BUST(HAND)=False
  269.          Say " Player wins hand"+Str$(HAND)+"."
  270.          PAY_EVENS
  271.          If HAND=2
  272.             Bob Off : Wait Vbl 
  273.          End If 
  274.       End If 
  275.       If DEALER_COUNT=PL4YER_COUNT(HAND) and BUST(HAND)=False
  276.          Say "Standoff on hand"+Str$(HAND)+"."
  277.          BANK=BANK+STAKE(HAND)
  278.          CLAIM_STAKE
  279.          If HAND=2
  280.             Bob Off : Wait Vbl 
  281.          End If 
  282.       End If 
  283.    Next HAND
  284.    Bob Off : Wait Vbl 
  285.    Goto ST4RT
  286. End If 
  287. Procedure ADJUST_HAND[N]
  288.    Shared RANK,NUM_OF_ACES()
  289.    If RANK>10 Then RANK=10
  290.    If RANK=1 Then RANK=11
  291.    If RANK=11
  292.       Inc NUM_OF_ACES(N)
  293.       SOFT(N)=True
  294.    End If 
  295. End Proc
  296. ' Thanks to Sprite editor for this Proc. 
  297. Procedure ALERT[W,H,C1,C2,NB,NL]
  298.    Shared Q,LINE$(),BUTTON$()
  299.    Reserve Zone 3
  300.    W=W*8
  301.    H=H*8
  302.    X=160-W/2
  303.    Y=50-H/2
  304.    Get Block 1,X,Y,W+16,H+16
  305.    Ink 0
  306.    Bar X+5,Y+5 To X+W+5,Y+H+5
  307.    Ink C1
  308.    Bar X,Y To X+W,Y+H
  309.    Ink C2
  310.    Box X+1,Y+1 To X+W-1,Y+H-1
  311.    S=W/8/(NB+1)+1
  312.    Paper C1
  313.    Pen C2
  314.    Curs Off 
  315.    A=0 : While A<NB
  316.       Locate X Text(X)+S/2+S*A,Y Text(Y+H)-2
  317.       Print Border$(Zone$(BUTTON$(A),1+A),2);
  318.    Inc A : Wend 
  319.    A=0 : While A<NL
  320.       Locate 0,Y Text(Y)+1+A
  321.       Centre LINE$(A)
  322.       Inc A
  323.    Wend 
  324.    Q=0
  325.    While Q=0
  326.       While Mouse Key=0 : Wend 
  327.       Z=Mouse Zone
  328.       If Z<1 or Z>1+NB
  329.          Bell 
  330.       Else 
  331.          Q=Z
  332.       End If 
  333.    Wend 
  334.    Put Block 1,X,Y
  335. End Proc
  336. Procedure CLAIM_STAKE
  337.    Shared DUBBLED()
  338.    TEMP_FL=DUBBLED(HAND)
  339.    If HAND=2 Then HAND=3
  340.    Channel 1 To Bob HAND
  341.    Channel 2 To Bob HAND+1
  342.    AM$="Move 0,40,25"
  343.    If BLUE_CHIPS>0
  344.       Amal 1,AM$
  345.    End If 
  346.    If RED_CHIPS>0
  347.       Amal 2,AM$
  348.    End If 
  349.    If TEMP_FL and BLUE_CHIPS>0
  350.       Channel 3 To Bob HAND+4 : Amal 3,AM$
  351.    End If 
  352.    If TEMP_FL and RED_CHIPS>0
  353.       Channel 4 To Bob HAND+5 : Amal 4,AM$
  354.    End If 
  355.    If HAND=3 Then HAND=2
  356.    Amal On 
  357.    While Chanmv(1) or Chanmv(2) or Chanmv(3) or Chanmv(4)
  358.    Wend 
  359.    Wait 35
  360. End Proc
  361. Procedure DEAL_CARD
  362.    Shared CARD_PACK$(),SUIT,RANK,T0P_CARD,BOTTOM_CARD
  363.    Shared PL0FFSETX,PL0FFSETY
  364.    Inc B0B
  365.    Inc T0P_CARD : 
  366.    If T0P_CARD=BOTTOM_CARD
  367.       SHUFFLE
  368.       Text 0,0,"         "
  369.       T0P_CARD=1
  370.       BOTTOM_CARD=197-Rnd(8)
  371.    End If 
  372.    SUIT=Val(Left$(CARD_PACK$(T0P_CARD),2))
  373.    RANK=Val(Right$(CARD_PACK$(T0P_CARD),2))
  374.    Bob B0B,POS*8+PL0FFSETX,POS*8+PL0FFSETY,9+(SUIT*13)+RANK
  375.    Sam Play 1,2,4000
  376.    Wait 2
  377. End Proc
  378. Procedure _D0UBLE_PROC
  379.    Shared DUBBLED(),HAND_FINISHED,RANK
  380.    BANK=BANK-STAKE(HAND)
  381.    DUBBLED(HAND)=True
  382.    Text 200,186,"�"+Str$(BANK)
  383.    STAKE(HAND)=STAKE(HAND)*2
  384.    Channel 1 To Bob 5
  385.    Channel 2 To Bob 6
  386.    If HAND=2
  387.       HAND=3
  388.       Channel 1 To Bob 7
  389.       Channel 2 To Bob 8
  390.    End If 
  391.    If BLUE_CHIPS>0
  392.       Bob HAND+4,160,186,I Bob(1)
  393.       Wait Vbl 
  394.       AM$="Move -"+Str$(160-X Bob(HAND)+20)+",-"+Str$(186-Y Bob(HAND))+",20"
  395.       Amal 1,AM$
  396.    End If 
  397.    If RED_CHIPS>0
  398.       Bob HAND+5,160,186,I Bob(2)
  399.       Wait Vbl 
  400.       AM$="Move -"+Str$(160-X Bob(HAND+1)+20)+",-"+Str$(186-Y Bob(HAND+1))+",20"
  401.       Amal 2,AM$
  402.    End If 
  403.    If HAND=3
  404.       HAND=2
  405.    End If 
  406.    Amal On 
  407.    While Chanmv(1) or Chanmv(2)
  408.    Wend 
  409.    Wait 35
  410.    DEAL_CARD
  411.    Wait 20
  412.    ADJUST_HAND[HAND]
  413.    PL4YER_COUNT(HAND)=PL4YER_COUNT(HAND)+RANK
  414.    ' If over 21 an ace has been drawn to 11, so reduce by 10
  415.    If PL4YER_COUNT(HAND)>21
  416.       PL4YER_COUNT(HAND)=PL4YER_COUNT(HAND)-10
  417.    End If 
  418.    HAND_FINISHED=True
  419. End Proc
  420. Procedure FRONT_END
  421.    Shared RESTART,T0P_CARD,SPEED,SPEED$,SPEED_ARR$()
  422.    Shared LINE$(),BUTTON$(),Q,HELPME
  423.    Do 
  424.       If RESTART=True
  425.          RESTART=False
  426.          T0P_CARD=0
  427.          Clear Key 
  428.          Fade 3 : Wait 45
  429.          Auto View Off 
  430.          Screen Open 1,320,200,32,Lowres
  431.          Fade 1 : Wait 15
  432.          'Load Iff "workbench:dpaint/lo-res/jack_title" 
  433.          Auto View On 
  434.          Unpack 7 To 1
  435.          Flash Off 
  436.          Fade 3,,,,,,,,,,,,,,,,,,,$940,$111,$222,$333,$444,$555,$666,$777,$888,$999,$AAA,$BBB,$CCC,$DDD
  437.          Wait 45
  438.          Fade 3,0,$FFF,$C00,$93,$A,$EF0,$F77,$E4F,$F0C,$A0F,$0,$FED,$FE0,$CCC,$888,$444
  439.          Wait 45
  440.          Menu$(1)="Details "
  441.          Menu$(2)="Options "
  442.          Menu$(3)="Info.   "
  443.          'Details   
  444.          Menu$(1,1)="Credits "
  445.          'options   
  446.          Menu$(2,1)="Play with Help    "
  447.          Menu$(2,2)="Play without Help "
  448.          Menu$(2,3)="Set Speed         "
  449.          Menu$(2,4)="Quit              "
  450.          'Rules 
  451.          Menu$(3,1)="How to Play.    "
  452.          Menu$(3,2)="House Rules.    "
  453.          Menu$(3,3)="Basic Strategy. "
  454.          Menu$(3,4)="Card Counting.  "
  455.          Menu On 
  456.       End If 
  457.       If Choice
  458.          FL=0
  459.          If Choice(1)=1 and Choice(2)=1
  460.             _PROCESS["details"]
  461.          End If 
  462.          If Choice(1)=2
  463.             If Choice(2)=1
  464.                HELPME=True
  465.                FL=1
  466.                Menu Off 
  467.             End If 
  468.             If Choice(2)=2
  469.                HELPME=False
  470.                FL=1
  471.                Menu Off 
  472.             End If 
  473.             If Choice(2)=3
  474.                SPEED$=SPEED_ARR$((SPEED-4)/3-1)
  475.                LINE$(0)="Select a Speed"
  476.                LINE$(1)="Current Speed "+SPEED$
  477.                BUTTON$(0)="Fast"
  478.                BUTTON$(1)="Med."
  479.                BUTTON$(2)="Slow"
  480.                Menu Off 
  481.                ALERT[22,8,1,2,3,2]
  482.                SPEED=Q*3+4
  483.                Menu On 
  484.             End If 
  485.             If Choice(2)=4
  486.                End 
  487.             End If 
  488.             If FL=1
  489.                Fade 2,,,,,,,,,,,,,,,,,,,$FFF,$EEF,$DDF,$CCF,$BBE,$AAE,$99D,$88D,$77C,$66C,$55B,$44B,$33B,$22A
  490.                Wait 18*1
  491.                Fade 2 : Rem Wait 32
  492.                Pop Proc : Rem This is the only way out of here!
  493.             End If 
  494.          End If 
  495.          If Choice(1)=3
  496.             If Choice(2)=1
  497.                _PROCESS["_instruct"]
  498.             End If 
  499.             If Choice(2)=2
  500.                _PROCESS["rules"]
  501.             End If 
  502.             If Choice(2)=3
  503.                _PROCESS["strategy"]
  504.             End If 
  505.             If Choice(2)=4
  506.                _PROCESS["count"]
  507.             End If 
  508.          End If 
  509.       End If 
  510.    Loop 
  511. End Proc
  512. Procedure HARD_D0UBLE_HELP
  513.    Shared HARD_DBL(),SOFT_DBL(),HARD_HIT(),SOFT_HIT(),SPLIT(),D0UBLE
  514.    ' 271 to 300 hard_dbl
  515.    _OFFSET=269
  516.    PL4Y=12-PL4YER_COUNT(HAND) : DEAL=DEALER_COUNT-1
  517.    SEL=Peek(Start(8)+_OFFSET+(PL4Y-1)*10+DEAL)
  518.    If SEL=1
  519.       LIGHT[4]
  520.       D0UBLE=True
  521.    End If 
  522. End Proc
  523. Procedure HARD_HIT_HELP
  524.    Shared HARD_DBL(),SOFT_DBL(),HARD_HIT(),SOFT_HIT(),SPLIT(),D0UBLE
  525.    ' 41  to 100   HARD_HIT
  526.    _OFFSET=39
  527.    If PL4YER_COUNT(HAND)<12
  528.       LIGHT[2]
  529.       Pop Proc
  530.    End If 
  531.    If PL4YER_COUNT(HAND)<17
  532.       PL4Y=18-PL4YER_COUNT(HAND) : DEAL=DEALER_COUNT-1
  533.       SEL=Peek(Start(8)+_OFFSET+(PL4Y-1)*10+DEAL)
  534.       If SEL=1
  535.          LIGHT[2]
  536.       Else 
  537.          LIGHT[1]
  538.       End If 
  539.    Else 
  540.       LIGHT[1]
  541.    End If 
  542. End Proc
  543. Procedure HELP
  544.    Shared HARD_DBL(),SOFT_DBL(),HARD_HIT(),SOFT_HIT(),SPLIT(),SPLIT_POSSIBLE
  545.    Shared POS,SPL1T,D0UBLE
  546.    If POS=2 : Rem Splits and Doubles only on 3rd card
  547.       'first look for splits 
  548.       SPL1T=False
  549.       If SPLIT_POSSIBLE and HAND=1
  550.          SPLIT_HELP
  551.       End If 
  552.       If SPL1T
  553.          Pop Proc
  554.       End If 
  555.       ' then check for doubles 
  556.       If PL4YER_COUNT(HAND)+(SOFT(HAND)*10)<12
  557.          D0UBLE=False
  558.          If PL4YER_COUNT(HAND)+(SOFT(HAND)*10)<9 and SOFT(HAND)
  559.             SOFT_DOUBLE_HELP
  560.          End If 
  561.          If PL4YER_COUNT(HAND)>8 and Not SOFT(HAND)
  562.             HARD_D0UBLE_HELP
  563.          End If 
  564.          If D0UBLE
  565.             Pop Proc
  566.          End If 
  567.       End If 
  568.    End If 
  569.    ' Then look at soft hands
  570.    If SOFT(HAND)
  571.       SOFT_HIT_HELP
  572.    Else 
  573.       HARD_HIT_HELP
  574.    End If 
  575.    '
  576. End Proc
  577. Procedure LIGHT[ADVICE]
  578.    Shared AN$
  579.    Sprite 1,185,137+ADVICE*16,65
  580.    Channel 9 To Sprite 1
  581.    Amal 9,AN$
  582.    Amal On 9
  583. End Proc
  584. Procedure _LOAD_ARRAY
  585.    Shared SPEED_ARR$()
  586.    For S=0 To 2
  587.       Read SPEED_ARR$(S)
  588.    Next S
  589.    Data "Fast","Med.","Slow"
  590. End Proc
  591. Procedure MAKE_CHIP_PILE[BET]
  592.    RED_CHIPS=BET mod 5 : BLUE_CHIPS=Int(BET/5)
  593.    If BET=0 Then RED_CHIPS=0
  594. End Proc
  595. Procedure MAKE_PACK
  596.    Shared CARD_PACK$()
  597.    CARD=1
  598.    For P4CK=1 To 4
  599.       For RANK=1 To 13
  600.          For SUIT=0 To 3
  601.             CARD_PACK$(CARD)=Str$(SUIT)+Str$(RANK)
  602.             Inc CARD
  603.          Next SUIT
  604.       Next RANK
  605.    Next P4CK
  606. End Proc
  607. Procedure M0USE_CHIP_MOVE
  608.    Rem get chips to follow pointer
  609.    Shared RED_CHIPS,BLUE_CHIPS,B0B
  610.    If RED_CHIPS>0
  611.       Bob B0B+1,X Screen(X Mouse),Y Screen(Y Mouse)-BLUE_CHIPS*2-1,RED_CHIPS
  612.    Else 
  613.       Bob Off B0B+1
  614.    End If 
  615.    If BLUE_CHIPS>0
  616.       Bob B0B,X Screen(X Mouse),Y Screen(Y Mouse),BLUE_CHIPS+4
  617.    Else 
  618.       Bob Off B0B
  619.    End If 
  620. End Proc
  621. Procedure PAY_EVENS
  622.    Shared DUBBLED()
  623.    TEMP_FL=DUBBLED(HAND)
  624.    BANK=BANK+STAKE(HAND)*2
  625.    B0B=B0B+HAND
  626.    If HAND=2 Then HAND=3
  627.    Channel 1 To Bob B0B
  628.    Channel 2 To Bob B0B+1
  629.    If BLUE_CHIPS>0
  630.       Bob B0B,0,0,I Bob(1)
  631.       AM$="Move"+Str$(X Bob(HAND))+"-20,"+Str$(Y Bob(HAND))+"-16,40"
  632.       Amal 1,AM$
  633.    End If 
  634.    If RED_CHIPS>0
  635.       Bob B0B+1,0,0,I Bob(2)
  636.       AM$="Move"+Str$(X Bob(HAND+1))+"-20,"+Str$(Y Bob(HAND+1))+"-16,40"
  637.       Amal 2,AM$
  638.    End If 
  639.    If TEMP_FL and BLUE_CHIPS>0
  640.       Bob B0B+2,0,0,I Bob(HAND+4)
  641.       AM$="Move"+Str$(X Bob(HAND+4))+"-20,"+Str$(Y Bob(HAND+4))+"-16,40"
  642.       Channel 3 To Bob B0B+2 : Amal 3,AM$
  643.    End If 
  644.    If TEMP_FL and RED_CHIPS>0
  645.       Bob B0B+3,0,0,I Bob(HAND+5)
  646.       AM$="Move"+Str$(X Bob(HAND+5))+"-20,"+Str$(Y Bob(HAND+5))+"-16,40"
  647.       Channel 4 To Bob B0B+3 : Amal 4,AM$
  648.    End If 
  649.    If HAND=3 Then HAND=2
  650.    Amal On 
  651.    While Chanmv(1) or Chanmv(2) or Chanmv(3) or Chanmv(4)
  652.    Wend 
  653.    Wait 35
  654. End Proc
  655. Procedure PAY_SIX_TO_4
  656.    Shared BET
  657.    Inc B0B
  658.    Channel 1 To Bob B0B
  659.    Channel 2 To Bob B0B+1
  660.    Channel 3 To Bob B0B+2
  661.    Channel 4 To Bob B0B+3
  662.    BANK=BANK+STAKE(HAND)+(STAKE(HAND)*1.5)
  663.    If BLUE_CHIPS>0
  664.       BLUE_X=X Bob(1) : BLUE_Y=Y Bob(1)
  665.       Bob B0B,0,0,I Bob(1)
  666.       AM$="Move"+Str$(BLUE_X)+"-20,"+Str$(BLUE_Y)+",40"
  667.       Amal 1,AM$
  668.    End If 
  669.    If RED_CHIPS>0
  670.       RED_X=X Bob(2) : RED_Y=Y Bob(2)
  671.       Bob B0B+1,0,0,I Bob(2)
  672.       AM$="Move"+Str$(RED_X)+"-20,"+Str$(RED_Y)+",40"
  673.       Amal 2,AM$
  674.    End If 
  675.    BET2=BET/2
  676.    If STAKE(HAND) mod 2=1
  677.       If OWES_50P
  678.          Inc BET2
  679.          Inc BANK
  680.          OWES_50P=False
  681.       Else 
  682.          OWES_50P=True
  683.       End If 
  684.    End If 
  685.    If BET2>0
  686.       MAKE_CHIP_PILE[BET2]
  687.       If BLUE_CHIPS>0
  688.          Bob B0B+2,0,0,4+BLUE_CHIPS
  689.          AM$="Move"+Str$(BLUE_X)+"-40,"+Str$(BLUE_Y)+",40"
  690.          Amal 3,AM$
  691.       End If 
  692.       If RED_CHIPS>0
  693.          Bob B0B+3,0,0,RED_CHIPS
  694.          AM$="Move"+Str$(Max(BLUE_X,RED_X))+"-40,"
  695.          AM$=AM$+Str$(Max(BLUE_Y,RED_Y))+"-5,40"
  696.          Amal 4,AM$
  697.       End If 
  698.    End If 
  699.    Amal On 
  700.    While Chanmv(1) or Chanmv(2) or Chanmv(3) or Chanmv(4)
  701.    Wend 
  702.    Wait 30
  703. End Proc
  704. Procedure PLACE_BET
  705.    Shared TLX(),TLY(),BRX(),BRY(),BET,WHERE,RESTART
  706.    BET_PLACED=False
  707.    BET=0
  708.    _UPDATE_BANK
  709.    Repeat : Rem incre/decrement bet until bet is placed
  710.       Z=Mouse Zone : K=Mouse Key
  711.       Wait 6
  712.       If K<>0
  713.          If Z=5
  714.             If K=1
  715.                If BET<25
  716.                   Inc BET
  717.                   Dec BANK
  718.                   _UPDATE_BANK
  719.                End If 
  720.             End If 
  721.             If K=2
  722.                If BET>0
  723.                   Dec BET
  724.                   Inc BANK
  725.                   _UPDATE_BANK
  726.                End If 
  727.             End If 
  728.          End If 
  729.          If Z=6
  730.             If K=1
  731.                If BET<21
  732.                   BET=BET+5
  733.                   BANK=BANK-5
  734.                   _UPDATE_BANK
  735.                End If 
  736.             End If 
  737.             If K=2
  738.                If BET>4
  739.                   BET=BET-5
  740.                   BANK=BANK+5
  741.                   _UPDATE_BANK
  742.                End If 
  743.             End If 
  744.          End If 
  745.       End If 
  746.       MAKE_CHIP_PILE[BET]
  747.       M0USE_CHIP_MOVE
  748.       Wait Vbl 
  749.       If K=1 and Z=7 and BET>0
  750.          BET_PLACED=True
  751.       End If 
  752.    Until BET_PLACED or Key State(69)=True
  753.    If Key State(69)=True Then RESTART=True
  754.    If BET mod 5=0 Then Bob Off B0B+1 : Rem loose a loose sprite.
  755.    Wait 10 : Rem this stops the mouse press carrying thru to next test. 
  756. End Proc
  757. Procedure _PROCESS[G$]
  758.    Screen Open 4,640,200,4,Hires
  759.    Curs Off 
  760.    Restore G$
  761.    A$=""
  762.    LINE=0
  763.    While A$<>"**"
  764.       Read A$
  765.       Locate 0,LINE
  766.       If A$="*"
  767.          Print " "
  768.          Print "               Press a key."
  769.          Wait Key 
  770.          Cls 
  771.          LINE=0
  772.       Else 
  773.          Print A$
  774.          Inc LINE
  775.       End If 
  776.    Wend 
  777.    Screen Close 4
  778.    RULES:
  779.    Data "                          Rules of the House."
  780.    Data "                          ==================="
  781.    Data " "
  782.    Data "1. Four decks of cards are used, and after each shuffle approximately"
  783.    Data "   12 cards are 'burned' from the bottom of the pack."
  784.    Data "   Each card has its face value.  Court cards count as ten.  Aces count"
  785.    Data "   as either 1 or 11, whichever is to the hand's advantage."
  786.    Data " "
  787.    Data "2. The player must bet before any cards are dealt."
  788.    Data " "
  789.    Data "3. All cards are dealt face up.  The dealer will deal two cards to the"
  790.    Data "   player and one to himself.  Only after the player has completed his"
  791.    Data "   hand will the dealer deal more cards to himself."
  792.    Data " "
  793.    Data "4. Any hand with a count of over 21 is 'bust'."
  794.    Data " "
  795.    Data "5. Dealer stands on a hand of 17 or more, whether hard or soft."
  796.    Data " "
  797.    Data "6. Dealer hits a hand of 16 or less."
  798.    Data "*"
  799.    Data "7. Player may stand at any time."
  800.    Data " "
  801.    Data "8. Player may double his bet after the second card but may not increase"
  802.    Data "   his bet thereafter."
  803.    Data " "
  804.    Data "9. Player may split his hand if his first two cards are of equal value"
  805.    Data "   except in the case of Court Cards and tens. Only one split is"
  806.    Data "   permitted per hand."
  807.    Data " "
  808.    Data "   Note: Although casinos allow splitting on tens and pairs of Court"
  809.    Data "         cards, this will not be offered in this program.  This is"
  810.    Data "         not a disadvantage to the player, because Standing on 20"
  811.    Data "         is far better than splitting tens."
  812.    Data "*"
  813.    Data " "
  814.    Data "10. Drawn hands (Standoffs) will be treated as 'No Bet'."
  815.    Data " "
  816.    Data "11. A player winning with a Blackjack (an Ace a ten or a Court card)"
  817.    Data "    will be paid one and a half times his stake, except in split hands,"
  818.    Data "    when the player will be paid 'evens'."
  819.    Data "    (As there are no 50p chips, in the case of Blackjack on a bet of an"
  820.    Data "    odd amount, the extra 50p will be added to the next similar payout"
  821.    Data "    thus rounding it up.)"
  822.    Data " "
  823.    Data "12. In the event of the dealer getting Blackjack the dealer wins unless the"
  824.    Data "    player has Blackjack, in which case it will count as 'no bet'."
  825.    Data "*"
  826.    Data "**"
  827.    _INSTRUCT:
  828.    Data "                         INSTRUCTIONS."
  829.    Data "                         ============="
  830.    Data "   The Game."
  831.    Data "   ---------"
  832.    Data "   The player must place a bet before any cards are dealt.  To do this"
  833.    Data "   use the mouse to pick up chips from either or both of the two boxes"
  834.    Data "   marked '�1' and '�5'.  The left mouse button will pick up chips"
  835.    Data "   (increase the bet); the right button will drop chips (decrease the"
  836.    Data "   bet)."
  837.    Data " "
  838.    Data "   To place the bet simply move the chips into the betting box and press"
  839.    Data "   the left button."
  840.    Data " "
  841.    Data "   The dealer will deal two cards to the player and one to himself."
  842.    Data "   It is now up the player make his choice of 'Stand', 'Hit', 'Double', or"
  843.    Data "   'Split' where allowable."
  844.    Data " "
  845.    Data "    The object of the gane, for both player and dealer, is to get as high"
  846.    Data "   a score as possible without going over 21."
  847.    Data "*"
  848.    Data "   Once the player has either bust (gone over 21) or stood (stopped"
  849.    Data "   drawing cards) on all his hands the dealer will deal his hand"
  850.    Data "   according to the rules."
  851.    Data "*"
  852.    Data " "
  853.    Data "                              OPTIONS."
  854.    Data "                              ========"
  855.    Data " "
  856.    Data "   If 'Play with Help' has been selected from the Options menu, one"
  857.    Data "   of the four red lights beside the play buttons will flash.  This is"
  858.    Data "   the advised play for the player's card count, having taken the dealer's"
  859.    Data "   card into consideration."
  860.    Data " "
  861.    Data "   If 'Play without Help' has been selected, advice is still available"
  862.    Data "   from the 'Help' key."
  863.    Data " "
  864.    Data "   The advice is based on accepted optimum strategy based purely on the"
  865.    Data "   player's and the dealer's hands.  NOT on any assumption or sneaky"
  866.    Data "   knowledge of what the next card may be."
  867.    Data " "
  868.    Data "   The 'Select Speed' option allows the player to vary the speed that the"
  869.    Data "   cards are dealt."
  870.    Data " "
  871.    Data "   Pressing <Esc> during play will return player to the Menu Screen."
  872.    Data "*"
  873.    Data "**"
  874.    COUNT:
  875.    Data "                          CARD COUNTING."
  876.    Data "                          =============="
  877.    Data "   The theory is that, by counting the cards played, one can assess"
  878.    Data "   whether the latter half of each pack is loaded towards the dealer"
  879.    Data "    or towards the player.  The size of the stakes are adjusted"
  880.    Data "    accordingly."
  881.    Data "  "
  882.    Data "    The card counting strategy is more effective when only one deck of"
  883.    Data "    cards is used.  However, in the U.K., four decks are always used and,"
  884.    Data "    as an additional deterrent, the last 15 or so cards are 'BURNED' after"
  885.    Data "    each shuffle. The dealer does this by inserting a blank card into"
  886.    Data "    the pack about a quarter of an inch from the bottom.  When the blank"
  887.    Data "    card is reached, the pack is reshuffled."
  888.    Data " "
  889.    Data "    Having said that, here are two strategies you may like to try."
  890.    Data "*"
  891.    Data "    Aces."
  892.    Data "      As the relative number of aces remaining in the pack increases,"
  893.    Data "    so does the chance of a Blackjack or of splitting on two aces."
  894.    Data "      If the ace count is low - increase the bet."
  895.    Data " "
  896.    Data "    Fives."
  897.    Data "      The fewer fives there are left in the pack, the more likely the"
  898.    Data "    dealer is to 'BUST'. So if a lot of fives come out, increase the"
  899.    Data "    stake and take fewer chances with 'BUSTING' yourself."
  900.    Data " "
  901.    Data "*"
  902.    Data "**"
  903.    STRATEGY:
  904.    Data "                             Strategy"
  905.    Data "                             ========"
  906.    Data ""
  907.    Data " "
  908.    Data "       At first glance the dealer has an enormous advantage in"
  909.    Data "    Blackjack, because he does not have to draw cards to his hand"
  910.    Data "    until all the players have either Stood or Bust.  So that if"
  911.    Data "    both the player and the dealer bust, the dealer wins on what"
  912.    Data "    is, in effect, a draw."
  913.    Data " "
  914.    Data "       To counter-balance this the player is allowed to Stand at"
  915.    Data "    any time, whereas the dealer MUST Hit a hand of sixteen or"
  916.    Data "    less.  In addition, the player is given the opportunity to"
  917.    Data "    increase his stake when the cards are in his favour, and"
  918.    Data "    the player gets paid at odds of six to four on a Blackjack."
  919.    Data "*"
  920.    Data " "
  921.    Data "       It follows that a knowledge of what are 'good' and what"
  922.    Data "    are 'bad' hands will help your money go that much further"
  923.    Data "    and, who knows, one day you may actually win something."
  924.    Data " "
  925.    Data "       There follows a table of what this program will train you"
  926.    Data "    to do."
  927.    Data " "
  928.    Data "    (Note: The term 'Hard hand' refers to hand which does not"
  929.    Data "    have any aces in it or a Soft hand which has gone over 21.)"
  930.    Data "*"
  931.    Data " "
  932.    Data "    PLAYER                PLAY"
  933.    Data "    ======                ===="
  934.    Data " "
  935.    Data "    Hitting on Hard Hands"
  936.    Data " "
  937.    Data "    Less than 12           Always Hit.  Cannot Bust."
  938.    Data "    12                     Hit when dealer has 2 or 3."
  939.    Data "    12 - 16                Hit when dealer has more than 6."
  940.    Data " "
  941.    Data "    Hitting Soft Hands"
  942.    Data " "
  943.    Data "    18 (Ace+7)             Hit when dealer has 9 or 10."
  944.    Data "    Less than 18           Always Hit."
  945.    Data "*"
  946.    Data " "
  947.    Data "    PLAYER                 PLAY"
  948.    Data "    ======                 ===="
  949.    Data " "
  950.    Data "    Doubling Hard Hands"
  951.    Data " "
  952.    Data "    11                     Always Double."
  953.    Data "    10                     When dealer has 2-9"
  954.    Data "     9                     When dealer has 2-6"
  955.    Data " "
  956.    Data "    Doubling Soft Hands"
  957.    Data " "
  958.    Data "    13 to 16               When dealer has 4-6"
  959.    Data "    17                     When dealer has 2-6"
  960.    Data "    18                     When dealer has 3-6"
  961.    Data "*"
  962.    Data " "
  963.    Data "    PLAYER                 PLAY"
  964.    Data "    ======                 ===="
  965.    Data ""
  966.    Data "    Splitting"
  967.    Data " "
  968.    Data "    Aces and 8s            Always Split."
  969.    Data "    10s and 5s             Never Split. (You wont be offered 10s)"
  970.    Data "    9s                     Not when dealer has 7,10 or Ace."
  971.    Data "    7s                     When dealer has 2-8."
  972.    Data "    6s                     When dealer has 2-7."
  973.    Data "    4s                     When dealer has 5."
  974.    Data "    3s and 2s              When dealer has 2-7."
  975.    Data "*"
  976.    Data "**"
  977.    DETAILS:
  978.    Data "    Blackjack Trainer is written by Peter Cartwright in AMOS."
  979.    Data " "
  980.    Data "    This is Version 1.0 and has not been heavily play tested (although"
  981.    Data "    I have done my best!), so any bug reports, suggestions and help"
  982.    Data "    will be most welcome."
  983.    Data " "
  984.    Data "    Address any comments, brickbats or donations to:"
  985.    Data " "
  986.    Data "       Peter Cartwright,"
  987.    Data "       68a Dornton Road,"
  988.    Data "       London. SW12 9NE."
  989.    Data "       081 673 0971."
  990.    Data " "
  991.    Data "    Possible later additions: Card counting strategy, user-defined"
  992.    Data "    Hitting strategy and automatic test runs. i.e. Letting the Amiga"
  993.    Data "    play x thousand hands using a given strategy and report results."
  994.    Data "*"
  995.    Data "**"
  996. End Proc
  997. Procedure SPLIT_HELP
  998.    Shared HARD_DBL(),SOFT_DBL(),HARD_HIT(),SOFT_HIT(),SPLIT(),SPL1T
  999.    ' 101 to 200 SPLIT_HELP
  1000.    _OFFSET=99
  1001.    PL4Y=PL4YER_COUNT(HAND)/2 : DEAL=DEALER_COUNT-1
  1002.    If PL4Y>6
  1003.       PL4Y=PL4Y-(PL4Y-6)*2
  1004.    Else 
  1005.       If PL4Y<>6
  1006.          PL4Y=PL4Y+(6-PL4Y)*2
  1007.       End If 
  1008.    End If 
  1009.    SEL=Peek(Start(8)+_OFFSET+(PL4Y-1)*10+DEAL)
  1010.    If SEL=1
  1011.       LIGHT[3]
  1012.       SPL1T=True
  1013.    End If 
  1014. End Proc
  1015. Procedure SOFT_HIT_HELP
  1016.    Shared HARD_DBL(),SOFT_DBL(),HARD_HIT(),SOFT_HIT(),SPLIT()
  1017.    ' 1 to 40 Soft_HIT 
  1018.    _OFFSET=-1
  1019.    DEAL=DEALER_COUNT-1
  1020.    If PL4YER_COUNT(HAND)>16
  1021.       PL4Y=PL4YER_COUNT(HAND)-16
  1022.       If PL4Y>4 : Rem this stops 21 overflowing the array
  1023.          PL4Y=4 : Rem but gives the same advice
  1024.       End If 
  1025.       SEL=Peek(Start(8)+_OFFSET+(PL4Y-1)*10+DEAL)
  1026.       If SEL=1
  1027.          LIGHT[2]
  1028.       Else 
  1029.          LIGHT[1]
  1030.       End If 
  1031.    Else 
  1032.       LIGHT[2]
  1033.    End If 
  1034. End Proc
  1035. Procedure SOFT_DOUBLE_HELP
  1036.    Shared HARD_DBL(),SOFT_DBL(),HARD_HIT(),SOFT_HIT(),SPLIT(),D0UBLE
  1037.    ' 201 to 270 SOFT_DBL
  1038.    _OFFSET=199
  1039.    PL4Y=19-PL4YER_COUNT(HAND) : DEAL=DEALER_COUNT-1
  1040.    SEL=Peek(Start(8)+_OFFSET+(PL4Y-1)*10+DEAL)
  1041.    If SEL=1
  1042.       LIGHT[4]
  1043.       D0UBLE=True
  1044.    End If 
  1045. End Proc
  1046. Procedure SET_ZONES
  1047.    Shared TLX(),TLY(),BRX(),BRY()
  1048.    For I=1 To 3 : Read TLX(I) : Read TLY(I)
  1049.    Read BRX(I) : Read BRY(I) : Next I
  1050.    Ink 1
  1051.    For I=1 To 3
  1052.       Box TLX(I),TLY(I) To BRX(I),BRY(I)
  1053.       Set Zone I+4,TLX(I),TLY(I) To BRX(I),BRY(I)
  1054.    Next I
  1055.    For I=0 To 3
  1056.       Set Zone I+1,3,106+16*I To 53,122+16*I
  1057.       Wait Vbl 
  1058.    Next I
  1059.    Data 130,174,162,194
  1060.    Data 161,174,194,194
  1061.    Data 142,104,175,158
  1062. End Proc
  1063. Procedure SHUFFLE
  1064.    Shared CARD_PACK$()
  1065.    Text 0,20,"SHUFFLING"
  1066.    For I=1 To 5
  1067.       Sam Play 1,3,9800
  1068.       Wait 40
  1069.    Next I
  1070.    Randomize Timer
  1071.    For I=208 To 2 Step -1
  1072.       J=Rnd(I)
  1073.       CARD_PACK$(0)=CARD_PACK$(J)
  1074.       CARD_PACK$(J)=CARD_PACK$(I)
  1075.       CARD_PACK$(I)=CARD_PACK$(0)
  1076.    Next I
  1077.    Text 0,20,"          "
  1078. End Proc
  1079. Procedure _SPLIT_PROC
  1080.    Shared PL0FFSETX,PL0FFSETY,PL4YERX(),PL4YERY,SPLIT,RANK,ADVICE_GIVEN
  1081.    Shared SPLIT_POSSIBLE
  1082.    SPLIT=True
  1083.    SPLIT_POSSIBLE=False : Rem Only one split allowed 
  1084.    Dec POS : Dec POS
  1085.    BANK=BANK-STAKE(HAND)
  1086.    Text 200,186,"�"+Str$(BANK)
  1087.    'Follow PL4YER_COUNT(1),PL4YER_COUNT(2),SOFT(1),SOFT(2)
  1088.    PL4YER_COUNT(1)=RANK
  1089.    PL4YER_COUNT(2)=RANK
  1090.    SOFT(HAND+1)=SOFT(HAND)
  1091.    NUM_OF_ACES(1)=1
  1092.    NUM_OF_ACES(2)=1
  1093.    STAKE(2)=STAKE(1)
  1094.    ' Move bottom card across
  1095.    Channel 1 To Bob B0B
  1096.    AM$="Move -106,-8,40"
  1097.    Amal 1,AM$ : Amal On 
  1098.    While Chanmv(1)
  1099.    Wend 
  1100.    Wait 20
  1101.    If BLUE_CHIPS>0
  1102.       _YOFFSET=186-Y Bob(1)
  1103.    Else 
  1104.       _YOFFSET=186-Y Bob(2)
  1105.    End If 
  1106.    AM$="Move 36,0,20"
  1107.    AM2$="Move -64,-"+Str$(_YOFFSET)+",20"
  1108.    Channel 1 To Bob 1
  1109.    Channel 2 To Bob 2
  1110.    Channel 3 To Bob 3
  1111.    Channel 4 To Bob 4
  1112.    Inc POS
  1113.    'place extra chips 
  1114.    If RED_CHIPS>0
  1115.       Bob 4,160,186-BLUE_CHIPS*2,I Bob(2)
  1116.       Amal 2,AM$
  1117.       Amal 4,AM2$
  1118.    End If 
  1119.    If BLUE_CHIPS>0
  1120.       Bob 3,160,186,I Bob(1)
  1121.       Amal 1,AM$
  1122.       Amal 3,AM2$
  1123.    End If 
  1124.    Amal On 
  1125.    While Chanmv(1)
  1126.    Wend 
  1127.    ' Deal one card to each hand ' 
  1128.    For I=1 To 2
  1129.       PL0FFSETX=PL4YERX(I) : PL0FFSETY=PL4YERY
  1130.       DEAL_CARD
  1131.       ADJUST_HAND[I]
  1132.       PL4YER_COUNT(I)=PL4YER_COUNT(I)+RANK
  1133.       ' check that it's not 2 aces 
  1134.       If PL4YER_COUNT(I)>21
  1135.          PL4YER_COUNT(I)=PL4YER_COUNT(I)-10
  1136.          Dec NUM_OF_ACES(I)
  1137.       End If 
  1138.       Wait 5
  1139.    Next I
  1140.    ' Hand points to first hand
  1141.    Bob 30,225,15,63
  1142.    Wait Vbl 
  1143.    Bell 
  1144.    Wait 40
  1145.    Inc POS
  1146.    PL0FFSETX=PL4YERX(1)
  1147.    ADVICE_GIVEN=False
  1148. End Proc
  1149. Procedure TAKE_MONEY
  1150.    Shared DUBBLED()
  1151.    TEMP_FL=DUBBLED(HAND)
  1152.    If HAND=2 Then HAND=3
  1153.    Channel 1 To Bob HAND
  1154.    Channel 2 To Bob HAND+1
  1155.    AM$="Move -70,-160,20"
  1156.    If BLUE_CHIPS>0 Then Amal 1,AM$
  1157.    If RED_CHIPS>0 Then Amal 2,AM$
  1158.    ' take care of doubles 
  1159.    If TEMP_FL and BLUE_CHIPS>0
  1160.       Channel 3 To Bob HAND+4 : Amal 3,AM$
  1161.    End If 
  1162.    If TEMP_FL and RED_CHIPS>0
  1163.       Channel 4 To Bob HAND+5 : Amal 4,AM$
  1164.    End If 
  1165.    Amal On 
  1166.    If HAND=3 Then HAND=2
  1167.    Wait 50
  1168. End Proc
  1169. Procedure _UPDATE_BANK
  1170.    Text 200,186,"�"+Str$(BANK)+"  "
  1171. End Proc